<?php


namespace Part26_SharingElementMode\Code3;

require_once '../../autoload.php';

$f = new WebSiteFactory();

$fx = $f->getWebSiteCategory('产品展示');
$fx->use();

// 共享上方生成的对象，不再实例化
$fy = $f->getWebSiteCategory('产品展示');
$fy->use();

$fz = $f->getWebSiteCategory('产品展示');
$fz->use();

$f1 = $f->getWebSiteCategory('博客');
$f1->use();
$f2 = $f->getWebSiteCategory('博客');
$f2->use();
$f3 = $f->getWebSiteCategory('博客');
$f3->use();

echo "网站分类总数为：{$f->getWebSiteCount()}";
